<?php
require('config.php');
require_once("dompdf/dompdf_config.inc.php");
  ob_start();
//$key = md5($_SESSION['username'].ENCRYPTION_KEY);
$myFile = "template_pdf.txt";
  require_once ($myFile);
  $html_message = ob_get_contents();
  ob_end_clean();
  if ( get_magic_quotes_gpc() )
    $_POST["html"] = stripslashes($html_message);
  $dompdf = new DOMPDF();
  $dompdf->load_html($html_message);
  $dompdf->set_paper('a4', 'orientation');
  $dompdf->render();
  $dompdf->stream("my_file_".time().'.pdf', array("Attachment" => true));
  exit(0);
  

?>


